<!--
 * @Author: your name
 * @Date: 2021-10-21 09:38:32
 * @LastEditTime: 2021-10-25 15:23:42
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \sike\arrow.html
-->
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //匿名函数的this经常为window，可以被call的第一个参数绑定，箭头函数的this自动绑定为当前词法作用域，会忽略call第一个参数
        let student = {name: "tom"};
        (function(){
            console.log(this.name);
        }).call(student);
        let name = "jim";
        let student2 = () => {
            let name = "alice";
            console.log(this.name);
        }
        student2();





        
        console.log(window===window.window);

    </script>
</body>
</html>